<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzb.erp.api.pc.clazz.mapper.GradeRecordMapper">

    <select id="getList" resultType="com.hzb.erp.api.pc.clazz.pojo.GradeRecordVO">
        select t1.*,
        t2.name student_name,
        t3.title grade_title
        from grade_record t1
        left join student t2 on t2.id = t1.student_id
        left join grade t3 on t3.id = t1.grade_id
        <where>
            <if test="param.gradeId != null">
                AND t1.grade_id = #{param.gradeId}
            </if>
            <if test="param.studentId != null">
                AND t1.student_id = #{param.studentId}
            </if>
        </where>
    </select>
</mapper>
